import {
  Color,
  Extend,
  Input,
  Link,
  Options,
  Radio,
  Select,
  Slider,
  Switch,
  UploadImage,
  selectPageVarAndCustom,
  Area,
  Mapping
} from '@/components/CustomPage/fields/widget'
import {
  Header,
  Footer,
  Swiper,
  Graphic,
  Category,
  GoodList,
  LiveSwiper,
  CardTwo,
  CardFour,
  CardFive,
  VGridview,
  HorizontalCardTwo,
  diamondArea,
  ninePalaceGrid,
  NoticeBarOne,
  NoticeBarTwo,
  ClassifyNewsListFixed,
  NewsListFixed,
  pictureContainer,
  capsuleChart,
  audioCourseListComp,
  specialArea,
  newsListStyleTwo,
  AnswerExercisesComp,
  dataListOne,
  AnswerContestComp,
  rushList4test,
  searchComp,
  mulClassifyComp,
  signInComp,
  integralMenuComp,
  integralTaskComp,
  figureClassifyComp,
  weekFocus,
  FigureStyleTwo,
  trainListComp,
  activityListComp,
  textFooter,
  imgFooterComp,
  logoutComp,
  graphicClassifyComp,
  specialListComp,
  specialListFixedNumberComp,
  courseListFixedComp,
  rushTrain,
  Empty,
  bookStyleComp,
  TimeAxis,
  globalSearchComp,
  affirm,
  exhibit,
  exhibitionRoom,
  exhibitionRoomFixed,
  exhibit_regular,
  Video,
  AudioFrequency,
  RichText
} from './../widget'
import { BasicOption } from './basicops'
import { DataOption } from './dataops'
import { DataOption4Img, DataOption4Footer } from './dataops4img'
import { DataOption4Video } from './dataops4Video'
import { DataOption4Audio } from './dataops4_audio'
import { DataOption4RichText } from './dataops4_rich_text'
import { cellTitleOps, titleOps } from '@/components/CustomPage/apps/map/cellTitleops'
import { moreLinkOps } from '@/components/CustomPage/apps/map/moreLinkops'
import { imgOption } from '@/components/CustomPage/apps/map/imgops'
import Types from '@/components/CustomPage/workflow/common/types'
import classify from './classify'
import swipe from './swipe'
import list from './list'
import news from './news'
import rank from './rank'
import integral from './integral'
import liveInfo from './liveInfo'
import { deepClone } from '@/utils'
import personal from './personal'
import navigation from './navigation'
import card from './card'
import onlineShow from './onlineShow'
import innovationStudio from './innovationStudio'
import servicePlatform from './servicePlatform'
import { labelOptions } from '@/components/CustomPage/apps/map/labelOps'
import { sourceOption } from '@/components/CustomPage/apps/map/source'
import { bgImgColor } from './bgImgColor'
import TitleComp from '@/components/CustomPage/apps/widget/titleComp/index'
import { radiusSizeOps } from '@/components/CustomPage/apps/map/radiusSizeOps'
const Fields = {
  header() {
    return {
      target: Header,
      parameter: {
        label: '页头'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            {
              type: Radio,
              option: {
                label: '类型',
                name: 'layout',
                list: [
                  { name: '导航', value: '1' },
                  { name: '头部', value: '2' }
                ],
                value: '1',
                override: function(ths, e) {
                  ths.$nextTick(() => {
                    const headerList = ['logo', 'logowidth', 'logoheight']
                    const navigationList = [
                      'title',
                      'textcolor',
                      'iconcolor',
                      'isShowRightIcon',
                      'textcolor',
                      'backType'
                    ]
                    for (
                      let i = 0;
                      i < ths.$parent.$parent.$children.length;
                      i++
                    ) {
                      const name = ths.$parent.$parent.$children[i].option.name

                      if (e === '2') {
                        if (headerList.indexOf(name) > -1) {
                          ths.$parent.$parent.$children[i].visible = true
                        } else if (navigationList.indexOf(name) > -1) {
                          ths.$parent.$parent.$children[i].visible = false
                          if (
                            name === 'backType' ||
														name === 'isShowRightIcon'
                          ) {
                            ths.$parent.$parent.$children[i].option.override(
                              ths,
                              name === 'isShowRightIcon' ? '2' : '1'
                            )
                          }
                        }
                      } else {
                        if (navigationList.indexOf(name) > -1) {
                          ths.$parent.$parent.$children[i].visible = true
                          if (
                            name === 'backType' ||
														name === 'isShowRightIcon'
                          ) {
                            ths.$parent.$parent.$children[i].option.override(
                              ths,
                              ths.$parent.$parent.$children[i].getValue()
                            )
                          }
                        } else if (headerList.indexOf(name) > -1) {
                          ths.$parent.$parent.$children[i].visible = false
                        }
                      }
                    }
                  })
                }
              }
            },
            {
              type: Slider,
              option: {
                label: '高度',
                name: 'height',
                value: 88,
                max: 200,
                step: 1
              }
            },
            {
              type: selectPageVarAndCustom,
              option: {
                label: '标题',
                name: 'title',
                allowcreate: true,
                filterable: true,
                value: ''
              }
            },
            {
              type: Color,
              option: {
                label: '标题颜色',
                name: 'textcolor',
                value: '#333',
                showalpha: true
              }
            },
            {
              type: Radio,
              option: {
                label: '返回类型',
                name: 'backType',
                list: [
                  { name: '返回上一页', value: '1' },
                  { name: '指定页面', value: '2' }
                ],
                value: '1',
                override: function(ths, e) {
                  ths.$nextTick(() => {
                    for (
                      let i = 0;
                      i < ths.$parent.$parent.$children.length;
                      i++
                    ) {
                      const name = ths.$parent.$parent.$children[i].option.name
                      if (name === 'backLink') {
                        console.log('backType', e)
                        ths.$parent.$parent.$children[i].visible = e === '2'
                      }
                    }
                  })
                }
              }
            },
            // { type: Input, option: { label: '跳转地址', name: 'backurl' }},
            { type: Link, option: { label: '跳转地址', name: 'backLink' }},
            {
              type: Color,
              option: {
                label: '返回按钮颜色',
                name: 'iconcolor',
                value: '#333',
                showalpha: true
              }
            },
            {
              type: Radio,
              option: {
                label: '展示右侧图标',
                name: 'isShowRightIcon',
                type: 'button',
                list: [
                  { name: '展示', value: '1' },
                  { name: '不展示', value: '2' }
                ],
                layout: 'horizon',
                value: '2',
                override: function(ths, e) {
                  ths.$nextTick(() => {
                    for (
                      let i = 0;
                      i < ths.$parent.$parent.$children.length;
                      i++
                    ) {
                      const name = ths.$parent.$parent.$children[i].option.name

                      if (
                        name === 'rightIcon' ||
												name === 'rightIconOper' ||
												name === 'rightIconHeight' ||
												name === 'rightIconWidth'
                      ) {
                        ths.$parent.$parent.$children[i].visible = e === '1'
                      }
                    }
                  })
                }
              }
            },
            {
              type: Select,
              option: {
                label: '右侧图标作用',
                name: 'rightIconOper',
                list: [
                  { name: '分享', value: '1' },
                  { name: '分数排行榜说明', value: '2' },
                  {
                    name: '积分排行榜说明',
                    value: '3'
                  }
                ],
                value: '1'
              }
            },
            {
              type: UploadImage,
              option: { label: '右侧图标', name: 'rightIcon' }
            },
            {
              type: Slider,
              option: {
                label: '图标高度',
                name: 'rightIconHeight',
                value: 48,
                max: 200,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '图标宽度',
                name: 'rightIconWidth',
                value: 48,
                max: 200,
                step: 1
              }
            },

            { type: UploadImage, option: { label: 'logo', name: 'logo' }},
            {
              type: Slider,
              option: {
                label: '图片宽度',
                name: 'logowidth',
                value: 430,
                max: 720,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '图片高度',
                name: 'logoheight',
                value: 68,
                max: 200,
                step: 1
              }
            }
          ]
        }
      ],
      valueType: Types.VALUETYPES.CATEGORYCHANGE
    }
  },
  footer() {
    return {
      target: Footer,
      parameter: {
        label: '底部导航'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            {
              type: Slider,
              option: {
                label: '高度',
                name: 'height',
                value: 88,
                max: 200,
                step: 1
              }
            },
            {
              type: Color,
              option: {
                label: '背景颜色',
                name: 'bgcolor',
                value: '#fff',
                showalpha: true
              }
            },
            {
              type: Color,
              option: {
                label: '默认文字颜色',
                name: 'textcolor',
                value: '#333',
                showalpha: true
              }
            }
            /* {
              type: Mapping,
              option: {
                label: '',
                name: 'mapping',
                list: [
                  { name: '图片地址', code: 'icon', value: '' },
                  { name: '菜单名称', code: 'name', value: '' }
                ]
              }
            }*/
          ]
        },
        // ...DataOption()
        ...DataOption4Footer('dataList', [{ name: '名称', param: 'name' }])
      ]
    }
  },
  searchComp() {
    return {
      target: searchComp,
      parameter: {
        label: '资源搜索',
        relate: true,
        mold: 'field'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            // {
            //   type: Input,
            //   option: { label: '组件名称', name: 'label', required: true, disabled: true }
            // },

            {
              type: Radio,
              option: {
                label: '背景颜色类型',
                name: 'colorType',
                list: [
                  { name: '自定义', value: true },
                  { name: '系统主题色', value: false }
                ],
                value: false,
                override: function(ths, e) {
                  ths.$nextTick(() => {
                    for (
                      let i = 0;
                      i < ths.$parent.$parent.$children.length;
                      i++
                    ) {
                      if (
                        ths.$parent.$parent.$children[i].option.name ===
												'btnColor'
                      ) {
                        ths.$parent.$parent.$children[i].visible = e
                      }
                    }
                  })
                }
              }
            },
            {
              type: Color,
              option: {
                label: '背景颜色',
                name: 'btnColor',
                value: '#2DA7B5',
                showalpha: true
              }
            },
            {
              type: Slider,
              option: {
                label: '高度',
                name: 'height',
                value: 88,
                max: 200,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '上内边距',
                name: 'paddingTop',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '下内边距',
                name: 'paddingBottom',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '左内边距',
                name: 'paddingLeft',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '右内边距',
                name: 'paddingRight',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '左右外边距',
                name: 'margins',
                value: 0,
                max: 100,
                step: 1
              }
            },
            { type: Input, option: { label: '提示词', name: 'placeholder' }},
            {
              type: Radio,
              option: {
                label: '是否固定定位',
                name: 'isFixed',
                list: [
                  { name: '是', value: '1' },
                  { name: '否', value: '2' }
                ],
                value: '2'
              }
            },
            {
              type: Slider,
              option: {
                label: '顶部距离',
                name: 'fixedToTop',
                value: 0,
                step: 1
              }
            },
            {
              type: Input,
              option: { label: '按钮文字', name: 'btnName', value: '' }
            }
          ]
        }
      ],
      valueType: Types.VALUETYPES.CATEGORYCHANGE
    }
  },
  mulClassifyComp() {
    // todo
    return {
      target: mulClassifyComp,
      parameter: {
        label: '多维度分类组件',
        relate: true,
        mold: 'field'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            // {
            //   type: Input,
            //   option: { label: '组件名称', name: 'label', required: true, disabled: true }
            // },
            {
              type: Slider,
              option: {
                label: '高度',
                name: 'height',
                value: 88,
                max: 200,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '上内边距',
                name: 'paddingTop',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '下内边距',
                name: 'paddingBottom',
                value: 0,
                max: 100,
                step: 1
              }
            },
            // {
            //   type: Slider,
            //   option: {
            //     label: '左内边距',
            //     name: 'paddingLeft',
            //     value: 0,
            //     max: 100,
            //     step: 1
            //   }
            // },
            // {
            //   type: Slider,
            //   option: {
            //     label: '右内边距',
            //     name: 'paddingRight',
            //     value: 0,
            //     max: 100,
            //     step: 1
            //   }
            // },
            // {
            //   type: Slider,
            //   option: {
            //     label: '左右外边距',
            //     name: 'margins',
            //     value: 0,
            //     max: 100,
            //     step: 1
            //   }
            // },
            {
              type: Radio,
              option: {
                label: '是否固定定位',
                name: 'isFixed',
                list: [
                  { name: '是', value: '1' },
                  { name: '否', value: '2' }
                ],
                value: '2'
              }
            },
            {
              type: Slider,
              option: {
                label: '顶部距离',
                name: 'fixedToTop',
                value: 0,
                step: 1
              }
            },
            {
              type: Input,
              option: {
                label: '数据name标识',
                name: 'dataName',
                value: 'classifyName'
              }
            },
            {
              type: Input,
              option: {
                label: '数据id标识',
                name: 'dataValue',
                value: 'id'
              }
            },
            {
              type: Input,
              option: {
                label: '数据parentId标识',
                name: 'dataParentId',
                value: 'parentId'
              }
            },
            {
              type: Input,
              option: {
                label: '数据icon标识',
                name: 'dataIcon',
                value: 'icon'
              }
            },
            {
              type: Input,
              option: {
                label: '数据children标识',
                name: 'dataChildren',
                value: 'children'
              }
            },
            {
              type: Select,
              option: {
                label: '组件样式',
                name: 'style',
                list: [
                  { name: '样式1', value: 1 },
                  { name: '样式2', value: 2 },
                  {
                    name: '样式3',
                    value: 3
                  },
                  { name: '样式4', value: 4 }
                ],
                value: 1
              }
            },
            {
              type: Color,
              option: {
                label: '背景颜色',
                name: 'bgColor',
                value: '#fff',
                showalpha: true
              }
            },
            {
              type: Color,
              option: {
                label: '未选中颜色',
                name: 'titleInactiveColor',
                value: '#333',
                showalpha: true
              }
            },
            {
              type: Radio,
              option: {
                label: '选中颜色类型',
                name: 'colorType',
                list: [
                  { name: '自定义', value: true },
                  { name: '系统主题色', value: false }
                ],
                value: false,
                override: function(ths, e) {
                  ths.$nextTick(() => {
                    for (
                      let i = 0;
                      i < ths.$parent.$parent.$children.length;
                      i++
                    ) {
                      if (
                        ths.$parent.$parent.$children[i].option.name ===
													'titleActiveColor' ||
												ths.$parent.$parent.$children[i].option.name === 'color'
                      ) {
                        ths.$parent.$parent.$children[i].visible = e
                      }
                    }
                  })
                }
              }
            },
            {
              type: Color,
              option: {
                label: '文字颜色',
                name: 'color',
                value: '#2DA7B5',
                showalpha: true
              }
            },
            {
              type: Color,
              option: {
                label: '选中颜色',
                name: 'titleActiveColor',
                value: '#2DA7B5',
                showalpha: true
              }
            }
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.CATEGORYCHANGE
    }
  },
  swiper() {
    return {
      target: Swiper,
      parameter: {
        relate: true,
        mold: 'field',
        label: '轮播图'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '高度',
                name: 'height',
                value: 380,
                max: 600,
                step: 10
              }
            },
            {
              type: Radio,
              option: {
                label: '圆角展示',
                name: 'radius',
                type: 'button',
                list: [
                  { name: '圆角', value: '1' },
                  { name: '直角', value: '2' }
                ],
                layout: 'horizon',
                value: '1'
              }
            },
            {
              type: Switch,
              option: {
                label: '是否显示指示器',
                name: 'indicators',
                value: true,
                activetext: '是',
                inactivetext: '否'
              }
            },
            {
              type: Switch,
              option: {
                label: '是否显示按钮',
                name: 'button',
                value: false,
                activetext: '是',
                inactivetext: '否'
              }
            }
          ]
        },
        {
          title: '数据设置',
          fields: [
            {
              type: Extend,
              option: {
                label: '图片',
                name: 'list',
                initalize: true,
                fields: [
                  {
                    type: UploadImage,
                    option: { label: '图片', name: 'icon', required: true }
                  },
                  { type: Link, option: { label: '链接地址', name: 'link' }}
                ]
              }
            }
          ]
        }
      ],
      valueType: Types.VALUETYPES.DATDLIST
    }
  },
  graphic() {
    return {
      target: Graphic,
      parameter: {
        relate: true,
        mold: 'field',
        label: '图文导航'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Select,
              option: {
                label: '展示形式',
                name: 'layout',
                list: [
                  { name: '一行三个', value: 3 },
                  { name: '一行四个', value: 4 },
                  { name: '一行五个', value: 5 }
                ],
                value: 3
              }
            },
            {
              type: Radio,
              option: {
                label: '圆角展示',
                name: 'radius',
                type: 'button',
                list: [
                  { name: '圆角', value: '1' },
                  { name: '直角', value: '2' }
                ],
                layout: 'horizon',
                value: '1'
              }
            },
            {
              type: Extend,
              option: {
                label: '',
                name: 'list',
                initalize: true,
                fields: [
                  {
                    type: UploadImage,
                    option: { label: '图标', name: 'icon', required: true }
                  },
                  {
                    type: Input,
                    option: { label: '标题', name: 'label', required: true }
                  },
                  {
                    type: Link,
                    option: { label: '链接地址', name: 'link', required: true }
                  }
                ]
              }
            },
            {
              type: Color,
              option: {
                label: '文字颜色',
                name: 'textcolor',
                value: '#333',
                showalpha: true
              }
            },
            {
              type: Color,
              option: {
                label: '背景颜色',
                name: 'bgcolor',
                value: '#fff',
                showalpha: true
              }
            }
          ]
        }
      ]
    }
  },
  category() {
    return {
      target: Category,
      parameter: {
        relate: true,
        mold: 'field',
        label: '带搜索的分类组件',
        value: []
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '高度',
                name: 'height',
                value: 88,
                max: 200,
                step: 1
              }
            },
            {
              type: Color,
              option: {
                label: '背景颜色',
                name: 'bgcolor',
                value: '#fff',
                showalpha: true
              }
            },
            {
              type: Color,
              option: {
                label: '文字颜色',
                name: 'textcolor',
                value: '#333',
                showalpha: true
              }
            },
            {
              type: Color,
              option: {
                label: '选中颜色',
                name: 'currentcolor',
                value: '',
                showalpha: true
              }
            },
            {
              type: Switch,
              option: {
                label: '是否吸顶',
                name: 'sticky',
                value: true,
                activetext: '是',
                inactivetext: '否'
              }
            }
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.CATEGORYCHANGE
    }
  },
  /**
	 * 固定数量的新闻列表
	 * @returns {{parameter: {relate: boolean, mold: string, label: string}, valueType: *, target: {mixins: [{computed: {margins(): *, top(): *, isEmptyShow(): *, height(): *, imgType(): *}, methods: {px2rem(*=): *, initData(): Promise<unknown>, toMore(*=): void, toDetail(*): void, setImgPath(*=, *=): (string|*), refresh(): void, clampText(): void, getParams(*=): ({}|*), getData(): Promise<unknown>}}], data(): {defaultClassList: [{id: string, classifyName: string}, {id: string, classifyName: string}], active: string, isNoData: boolean, list: [], classList: [], defaultList: [{publishTime: string, mainTitle: string, id: string}, {publishTime: string, mainTitle: string, id: string}, {publishTime: string, mainTitle: string, id: string}]}, created(): void, methods: {getNewsList(*=): Promise<unknown> | Promise<unknown>, getNewsClassify(): Promise<unknown> | Promise<unknown>}, name: string, props: {isInitData: {default: boolean, type: Boolean | BooleanConstructor}, option: {default: {}, type: Object | ObjectConstructor}}}, option: [{title: string, fields}]}}
	 */
  newListFixed() {
    return {
      target: NewsListFixed,
      parameter: {
        relate: false,
        mold: 'field',
        label: '新闻列表(固定数量)'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'paddingLeftRight',
                value: 0,
                max: 50,
                step: 1
              }
            },
            {
              type: Switch,
              option: {
                label: '是否立即初始化',
                name: 'isInit',
                value: true,
                activetext: '是',
                inactivetext: '否'
              }
            },
            { type: Link, option: { label: '详情地址', name: 'link' }},
            { type: Link, option: { label: '查看更多地址', name: 'moreLink' }}
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.CATEGORYCHANGE
    }
  },
  /**
	 * 闯关列表
	 * @returns {{parameter: {relate: boolean, mold: string, label: string}, valueType: *, target: {mixins: [{computed: {margins(): *, top(): *, isEmptyShow(): *, height(): *, imgType(): *}, methods: {px2rem(*=): *, initData(): Promise<unknown>, toMore(*=): void, toDetail(*): void, setImgPath(*=, *=): (string|*), refresh(): void, clampText(): void, getParams(*=): ({}|*), getData(): Promise<unknown>}}], data(): {defaultClassList: [{id: string, classifyName: string}, {id: string, classifyName: string}], active: string, isNoData: boolean, list: [], classList: [], defaultList: [{publishTime: string, mainTitle: string, id: string}, {publishTime: string, mainTitle: string, id: string}, {publishTime: string, mainTitle: string, id: string}]}, created(): void, methods: {getNewsList(*=): Promise<unknown> | Promise<unknown>, getNewsClassify(): Promise<unknown> | Promise<unknown>}, name: string, props: {isInitData: {default: boolean, type: Boolean | BooleanConstructor}, option: {default: {}, type: Object | ObjectConstructor}}}, option: [{title: string, fields}]}}
	 */
  rushList4test() {
    return {
      target: rushList4test,
      parameter: {
        relate: false,
        mold: 'field',
        label: '测试闯关列表'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'margins',
                value: 0,
                max: 100,
                step: 1
              }
            }
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.CATEGORYCHANGE
    }
  },
  goodlist() {
    return {
      target: GoodList,
      parameter: {
        mold: 'field',
        label: '商品列表',
        value: '',
        list: [
          { name: '商品名称', desc: '', price: 1, icon: '' },
          { name: '商品名称', desc: '', price: 1, icon: '' },
          { name: '商品名称', desc: '', price: 1, icon: '' }
        ]
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Color,
              option: {
                label: '背景颜色',
                name: 'bgcolor',
                value: '#fff',
                showalpha: true
              }
            }
          ]
        },
        {
          title: '请求配置',
          fields: []
        }
      ]
    }
  },
  cardTwo() {
    return {
      target: CardTwo
    }
  },
  cardFour() {
    return {
      target: CardFour
    }
  },
  cardFive() {
    return {
      target: CardFive
    }
  },
  liveSwiper() {
    return {
      target: LiveSwiper,
      parameter: {
        relate: false,
        label: '直播大图轮播'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '高度',
                name: 'height',
                value: 580,
                max: 700,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '左右间距',
                name: 'paddingLeftRight',
                value: 0,
                max: 40,
                step: 1
              }
            },
            ...imgOption(),
            {
              type: Switch,
              option: {
                label: '是否显示指示器',
                name: 'indicators',
                value: true,
                activetext: '是',
                inactivetext: '否'
              }
            },
            {
              type: Switch,
              option: {
                label: '是否自动轮播',
                name: 'isAutoPlay',
                value: true,
                activetext: '是',
                inactivetext: '否',
                override: function(ths, e) {
                  ths.$nextTick(() => {
                    for (
                      let i = 0;
                      i < ths.$parent.$parent.$children.length;
                      i++
                    ) {
                      if (
                        ths.$parent.$parent.$children[i].option.name ===
												'delayTime'
                      ) {
                        ths.$parent.$parent.$children[i].visible = e
                      }
                    }
                  })
                }
              }
            },
            {
              type: Input,
              option: {
                label: '自动轮播时间（秒）',
                value: 5,
                name: 'delayTime'
              }
            },
            { type: Link, option: { label: '详情地址', name: 'link' }},
            ...labelOptions()
          ]
        },
        ...DataOption()
      ]
    }
  },
  /**
	 * banner样式一
	 * @constructor
	 */
  NoticeBarOne() {
    return {
      target: NoticeBarOne,
      parameter: {
        relate: true,
        mold: 'field',
        label: '公告条滚动组件1'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右间距',
                name: 'spacing',
                value: 0,
                max: 40,
                step: 1
              }
            },
            {
              type: Input,
              option: {
                label: '自动轮播时间（秒）',
                value: 5,
                name: 'delayTime'
              }
            },
            { type: Link, option: { label: '详情地址', name: 'link' }},
            { type: Link, option: { label: '更多跳转地址', name: 'moreLink' }}
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  NoticeBarTwo() {
    return {
      target: NoticeBarTwo,
      parameter: {
        relate: true,
        mold: 'field',
        label: '公告条滚动组件2'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右间距',
                name: 'spacing',
                value: 0,
                max: 40,
                step: 1
              }
            },
            {
              type: Input,
              option: {
                label: '自动轮播时间（秒）',
                value: 5,
                name: 'delayTime'
              }
            },
            { type: Link, option: { label: '详情地址', name: 'link' }},
            { type: Link, option: { label: '更多跳转地址', name: 'moreLink' }}
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  /**
	 * 图片容器组件
	 * @constructor
	 */
  vgridview() {
    return {
      target: VGridview,
      parameter: {
        relate: true,
        mold: 'field',
        label: '图片容器组件'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            ...cellTitleOps(),
            {
              type: Color,
              option: {
                label: '单元背景颜色',
                name: 'backgroundColorC',
                value: 'rgba(255, 255, 255, 0)',
                showalpha: true
              }
            },
            ...bgImgColor(),
            {
              type: Select,
              option: {
                label: '展示模式',
                name: 'showType',
                list: [
                  { name: '单图网格', value: '1' },
                  { name: '两图网格', value: '2' },
                  { name: '三图网格', value: '3' },
                  { name: '四图网格', value: '4' },
                  { name: '五图网格', value: '5' },
                  { name: '六图网格', value: '6' },
                  { name: '十图网格', value: '10' }
                ],
                value: '1'
              }
            },
            // {
            //   type: Select,
            //   option: {
            //     label: '图片填充模式',
            //     name: 'imgType',
            //     list: [{ name: '填充满', value: 'fill' }, { name: '等比', value: 'contain' }],
            //     value: 'fill'
            //   }
            // },
            ...imgOption(),
            {
              type: Switch,
              option: {
                label: '是否显示标题',
                name: 'isShowTitle',
                value: true,
                activetext: '是',
                inactivetext: '否'
              }
            },
            {
              type: Switch,
              option: {
                label: '是否显示副标题',
                name: 'isShowSubtitle',
                value: true,
                activetext: '是',
                inactivetext: '否'
              }
            },
            ...moreLinkOps()
          ]
        },
        ...DataOption4Img('dataList', [
          { name: '标题', param: 'title' },
          { name: '副标题', param: 'subtitle' }
        ])
      ]
    }
  },

  /**
	 * 横版卡片（一排两个）
	 */
  figurestyletwo() {
    return {
      target: FigureStyleTwo,
      parameter: {
        relate: true,
        mold: 'field',
        label: '横版卡片（一排两个）'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            ...sourceOption(),
            {
              type: Slider,
              option: {
                label: '左右间距',
                name: 'spacing',
                value: 20,
                max: 100,
                step: 1
              }
            },
            ...cellTitleOps(),
            ...bgImgColor(),
            {
              type: Slider,
              option: {
                label: '图片高度',
                name: 'imgHeight',
                value: 178,
                max: 500,
                min: 1,
                step: 1
              }
            },
            ...imgOption(),
            {
              type: Radio,
              option: {
                label: '是否展示副标题',
                name: 'showSubTilte',
                list: [
                  { name: '是', value: true },
                  { name: '否', value: false }
                ],
                value: true
              }
            },
            // {
            //   type: Input,
            //   option: {
            //     label: '展示数量',
            //     name: 'number',
            //     value: 1,
            //     type: 'number'
            //   }
            // },
            ...moreLinkOps(),
            {
              type: Select,
              option: {
                label: '资源类型',
                name: 'resource',
                list: [
                  { name: '人物（劳模工匠）', value: 'lmgj' },
                  { name: '人物（大师）', value: 'ds' },
                  { name: '人物（讲师）', value: 'js' },
                  { name: '视频课程', value: 'spkc' },
                  { name: '直播', value: 'zb' },
                  { name: '活动', value: 'hd' },
                  { name: '闯关', value: 'cg' },
                  { name: '专区', value: 'zq' }
                ],
                value: 'lmgj',
                override: function(ths, e) {
                  ths.$nextTick(() => {
                    for (
                      let i = 0;
                      i < ths.$parent.$parent.$children.length;
                      i++
                    ) {
                      if (
                        ths.$parent.$parent.$children[i].option.name ===
												'ActivityLabel'
                      ) {
                        ths.$parent.$parent.$children[i].visible =
													e === 'hd' || e === 'zb'
                      }
                      if (
                        ths.$parent.$parent.$children[i].option.name === 'link'
                      ) {
                        ths.$parent.$parent.$children[i].visible =
													e !== 'hd' && e !== 'cg' && e !== 'zq'
                      }
                    }
                  })
                }
              }
            },
            ...labelOptions(),
            { type: Link, option: { label: '详情地址', name: 'link' }},
            {
              type: Mapping,
              option: {
                label: '',
                name: 'mapping',
                list: [
                  { name: '封面', code: 'imgId', value: '' },
                  { name: 'oss封面', code: 'imgUrl', value: '' },
                  { name: '标题', code: 'title', value: '' },
                  { name: '副标题', code: 'subTitle', value: '' }
                ]
              }
            }
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  horizontalCardTwo() {
    return {
      target: HorizontalCardTwo,
      parameter: {
        relate: true,
        mold: 'field',
        label: '横版卡片（一排一个）'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右间距',
                name: 'spacing',
                value: 20,
                max: 100,
                step: 1
              }
            },
            ...cellTitleOps(),
            {
              type: Slider,
              option: {
                label: '图片高度',
                name: 'imgHeight',
                value: 176,
                max: 500,
                min: 1,
                step: 1
              }
            },
            ...imgOption(),
            {
              type: Radio,
              option: {
                label: '是否展示副标题',
                name: 'showSubTilte',
                list: [
                  { name: '是', value: true },
                  { name: '否', value: false }
                ],
                value: true
              }
            },
            {
              type: Radio,
              option: {
                label: '是否展示三级标题',
                name: 'showThirdTilte',
                list: [
                  { name: '是', value: true },
                  { name: '否', value: false }
                ],
                value: true
              }
            },
            {
              type: Radio,
              option: {
                label: '是否展示四级标题',
                name: 'showFourthTilte',
                list: [
                  { name: '是', value: true },
                  { name: '否', value: false }
                ],
                value: true
              }
            },
            {
              type: Input,
              option: {
                label: '展示数量',
                name: 'number',
                value: 1,
                type: 'number'
              }
            },
            ...moreLinkOps(),
            {
              type: Select,
              option: {
                label: '资源类型',
                name: 'resource',
                list: [
                  { name: '人物（劳模工匠）', value: 'lmgj' },
                  { name: '人物（大师）', value: 'ds' },
                  { name: '人物（讲师）', value: 'js' },
                  { name: '视频课程', value: 'spkc' },
                  { name: '直播', value: 'zb' },
                  { name: '活动', value: 'hd' },
                  { name: '闯关', value: 'cg' },
                  { name: '专区', value: 'zq' }
                ],
                value: 'lmgj',
                override: function(ths, e) {
                  ths.$nextTick(() => {
                    for (
                      let i = 0;
                      i < ths.$parent.$parent.$children.length;
                      i++
                    ) {
                      if (
                        ths.$parent.$parent.$children[i].option.name ===
												'ActivityLabel'
                      ) {
                        ths.$parent.$parent.$children[i].visible =
													e === 'hd' || e === 'zb'
                      }
                      if (
                        ths.$parent.$parent.$children[i].option.name === 'link'
                      ) {
                        ths.$parent.$parent.$children[i].visible =
													e !== 'hd' && e !== 'cg' && e !== 'zq'
                      }
                    }
                  })
                }
              }
            },
            ...labelOptions(),
            { type: Link, option: { label: '详情地址', name: 'link' }},
            {
              type: Mapping,
              option: {
                label: '',
                name: 'mapping',
                list: [
                  { name: '封面', code: 'imgId', value: '' },
                  { name: 'oss封面', code: 'imgUrl', value: '' },
                  { name: '标题', code: 'title', value: '' },
                  { name: '副标题', code: 'subTitle', value: '' },
                  { name: '三级标题', code: 'thirdTitle', value: '' },
                  { name: '四级标题', code: 'fourthTitle', value: '' }
                ]
              }
            }
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },

  ...classify,
  ...swipe,
  ...list,
  ...news,
  ...rank,
  ...integral,
  ...liveInfo,
  ...personal,
  ...navigation,
  ...card,
  ...onlineShow,
  ...innovationStudio,
  ...servicePlatform,
  diamondArea() {
    return {
      target: diamondArea,
      parameter: {
        relate: true,
        mold: 'field',
        label: '金刚区组件'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'spacing',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '上下内间距',
                name: 'paddingTopBottom',
                value: 20,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '圆角大小',
                name: 'radiusSize',
                value: 16,
                max: 50,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '图标宽度',
                name: 'imageWidth',
                value: 80,
                max: 150,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '图标高度',
                name: 'imageHeight',
                value: 80,
                max: 150,
                step: 1
              }
            },
            ...bgImgColor(),
            // { type: Color,
            //   option: {
            //     label: '背景颜色',
            //     name: 'backgroundColor',
            //     value: 'rgba(255, 255, 255, 1)',
            //     showalpha: true
            //   }
            // },
            /* {
                          type: Input,
                          option: {
                            label: '展示数量',
                            name: 'showNumber',
                            value: 8
                          }
                        },*/
            {
              type: Select,
              option: {
                label: '每行展示数量',
                name: 'showType',
                list: [
                  { name: '3个', value: '33.3%' },
                  { name: '4个', value: '25%' },
                  {
                    name: '5个',
                    value: '20%'
                  }
                ],
                value: '25%'
              }
            },
            {
              type: Mapping,
              option: {
                label: '',
                name: 'mapping',
                list: [
                  { name: '图片地址', code: 'icon', value: '' },
                  { name: '菜单名称', code: 'name', value: '' }
                ]
              }
            }
          ]
        },
        ...DataOption4Img('dataList', [{ name: '名称', param: 'name' }])
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },

  graphicClassifyComp() {
    return {
      target: graphicClassifyComp,
      parameter: {
        relate: true,
        mold: 'field',
        label: '图文分类组件'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右外边距',
                name: 'spacing',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '上下内间距',
                name: 'paddingTopBottom',
                value: 20,
                max: 100,
                step: 1
              }
            },
            ...imgOption(),
            {
              type: Slider,
              option: {
                label: '图标宽度',
                name: 'imageWidth',
                value: 70,
                max: 150,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '图标高度',
                name: 'imageHeight',
                value: 74,
                max: 150,
                step: 1
              }
            },
            /* {
                          type: Input,
                          option: {
                            label: '展示数量',
                            name: 'showNumber',
                            value: 8
                          }
                        },*/
            {
              type: Select,
              option: {
                label: '每行展示数量',
                name: 'showType',
                list: [
                  { name: '4个', value: '25%' },
                  { name: '5个', value: '20%' }
                ],
                value: '25%'
              }
            },
            {
              type: Mapping,
              option: {
                label: '',
                name: 'mapping',
                list: [{ name: '标题', code: 'classifyName', value: '' }]
              }
            }
          ]
        },
        ...DataOption4Img('dataList', [
          { name: '标题', param: 'classifyName' }
        ])
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  TimeAxis() {
    return {
      target: TimeAxis,
      parameter: {
        relate: true,
        mold: 'field',
        label: '时间轴组件'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Radio,
              option: {
                label: '时间轴方向',
                name: 'timeAxisDirection',
                list: [
                  { name: '横向', value: '1' },
                  { name: '竖向', value: '2' }
                ],
                value: '2'
              }
            },
            {
              type: Slider,
              option: {
                label: '左右内边距',
                name: 'spacing',
                value: 20,
                min: 2,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '时间轴高度',
                name: 'timeAxisHeight',
                value: 417,
                max: 1000,
                step: 1
              }
            },
            ...cellTitleOps(),
            {
              type: UploadImage,
              option: { label: '背景图片', name: 'imgBg', required: true }
            },
            ...moreLinkOps(),
            { type: Link, option: { label: '详情地址', name: 'link' }}
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  // 视频组件
  Video() {
    return {
      target: Video,
      parameter: {
        relate: true,
        mold: 'field',
        label: '视频组件'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右内边距',
                name: 'spacing',
                value: 20,
                min: 2,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '视频容器高度',
                name: 'videoHeight',
                value: 200,
                max: 1000,
                step: 1
              }
            }
          ]
        },
        ...DataOption4Video('dataList', [{ name: '名称', param: 'name' }])
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  // 音频组价
  AudioFrequency() {
    return {
      target: AudioFrequency,
      parameter: {
        relate: true,
        mold: 'field',
        label: '视频组件'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右内边距',
                name: 'spacing',
                value: 20,
                min: 2,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '视频容器高度',
                name: 'videoHeight',
                value: 200,
                max: 1000,
                step: 1
              }
            }
          ]
        },
        ...DataOption4Audio('dataList', [{ name: '名称', param: 'name' }])
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  // 富文本组件
  RichText() {
    return {
      target: RichText,
      parameter: {
        relate: true,
        mold: 'field',
        label: '富文本组件'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右内边距',
                name: 'spacing',
                value: 20,
                min: 2,
                max: 100,
                step: 1
              }
            }
          ]
        },
        ...DataOption4RichText('dataList', [{ name: '名称', param: 'name' }])
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  ninePalaceGrid() {
    return {
      target: ninePalaceGrid,
      parameter: {
        relate: true,
        mold: 'field',
        label: '九宫格课程分类组件'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右内边距',
                name: 'spacing',
                value: 20,
                min: 2,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '左右外间距',
                name: 'paddingLeftRight',
                value: 24,
                min: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '九宫格高度',
                name: 'height',
                value: 417,
                max: 600,
                step: 1
              }
            },
            ...cellTitleOps(),
            {
              type: UploadImage,
              option: { label: '背景图片', name: 'imgBg', required: true }
            },
            ...moreLinkOps(),
            { type: Link, option: { label: '详情地址', name: 'link' }}
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  /**
	 * 带分类的新闻列表(固定数量)
	 */
  classifynewslistfixed() {
    return {
      target: ClassifyNewsListFixed,
      parameter: {
        relate: true,
        mold: 'field',
        label: '带分类的新闻列表(固定数量)'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'margins',
                value: 0,
                max: 100,
                step: 1
              }
            },
            { type: Link, option: { label: '详情地址', name: 'link' }}
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  // 每周重点
  weekFocus() {
    return {
      target: weekFocus,
      parameter: {
        relate: true,
        mold: 'field',
        label: '每周重点'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            // { type: Input, option: { label: '标题名称', name: 'moduleName',value: '每周重点'}},
            ...cellTitleOps(),
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'margins',
                value: 24,
                max: 100,
                step: 1
              }
            },
            // ...moreLinkOps(),
            {
              type: Input,
              option: {
                label: '不展示查看更多',
                name: 'isMore',
                value: '2',
                visible: false
              }
            } // 此项配置因每周重点引用了公共头部组件cellTitle,需将查看更多隐藏
          ]
        },

        ...DataOption()
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  /**
	 * 培训班列表
	 */
  trainListComp() {
    return {
      target: trainListComp,
      parameter: {
        relate: false,
        mold: 'field',
        label: '培训班列表'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'margins',
                value: 0,
                max: 100,
                step: 1
              }
            }
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  // 闯关练兵
  rushTrain() {
    return {
      target: rushTrain,
      parameter: {
        relate: true,
        mold: 'field',
        label: '首页闯关练兵'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            ...cellTitleOps(),
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'margins',
                value: 0,
                max: 100,
                step: 1
              }
            },
            // {
            //   type: Switch,
            //   option: {
            //     label: '是否展示标题名称',
            //     name: 'isShowModuleName',
            //     value: true,
            //     activetext: '是',
            //     inactivetext: '否',
            //     override: function(ths, e) {
            //       ths.$nextTick(() => {
            //         for (let i = 0; i < ths.$parent.$parent.$children.length; i++) {
            //           if (ths.$parent.$parent.$children[i].option.name === 'moduleName') {
            //             ths.$parent.$parent.$children[i].visible = e
            //           }
            //         }
            //       })
            //     }
            //   }
            // },
            // { type: Input, option: { label: '标题名称', name: 'moduleName' }},
            ...moreLinkOps()
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  /**
	 * 腰图组件
	 * @constructor
	 */
  pictureContainer() {
    return {
      target: pictureContainer,
      parameter: {
        relate: true,
        mold: 'field',
        label: '腰图'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            ...radiusSizeOps(),
            {
              type: Slider,
              option: {
                label: '高度',
                name: 'height',
                value: 250,
                max: 400,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'spacing',
                value: 0,
                max: 100,
                step: 1
              }
            },
            ...imgOption(),
            {
              type: Slider,
              option: {
                label: '圆角大小',
                name: 'radiusSize',
                value: 12,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '轮播时长间隔（秒）',
                name: 'autoplay',
                value: 3,
                max: 60,
                min: 0,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '轮播动画时长（秒）',
                name: 'duration',
                value: 1,
                max: 30,
                min: 0,
                step: 0.5
              }
            },
            {
              type: Radio,
              option: {
                label: '是否循环',
                name: 'loop',
                list: [
                  { name: '是', value: true },
                  { name: '否', value: false }
                ],
                value: true
              }
            },
            {
              type: Radio,
              option: {
                label: '是否显示指示器',
                name: 'indicators',
                list: [
                  { name: '是', value: true },
                  { name: '否', value: false }
                ],
                value: true
              }
            },
            {
              type: Radio,
              option: {
                label: '指示器颜色类型',
                name: 'indicatorsColorType',
                list: [
                  { name: '自定义', value: false },
                  { name: '系统主题色', value: true }
                ],
                value: true,
                override: function(ths, e) {
                  ths.$nextTick(() => {
                    for (
                      let i = 0;
                      i < ths.$parent.$parent.$children.length;
                      i++
                    ) {
                      if (
                        ths.$parent.$parent.$children[i].option.name ===
												'indicatorsColor'
                      ) {
                        ths.$parent.$parent.$children[i].visible = !e
                      }
                    }
                  })
                }
              }
            },
            {
              type: Color,
              option: {
                label: '指示器颜色',
                name: 'indicatorsColor',
                value: 'rgba(255, 255, 255, 1)',
                showalpha: true
              }
            },
            {
              type: Mapping,
              option: {
                label: '',
                name: 'mapping',
                list: [{ name: '图片地址', code: 'pic', value: '' }]
              }
            }
          ]
        },
        ...DataOption4Img('dataList', [])
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  /**
	 * 胶囊图
	 * @constructor
	 */
  capsuleChart() {
    return {
      target: capsuleChart,
      parameter: {
        relate: true,
        mold: 'field',
        label: '胶囊图'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            ...radiusSizeOps(),
            {
              type: Slider,
              option: {
                label: '高度',
                name: 'height',
                value: 250,
                max: 400,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'spacing',
                value: 0,
                max: 100,
                step: 1
              }
            },
            ...imgOption(),
            {
              type: Slider,
              option: {
                label: '轮播时长间隔（秒）',
                name: 'autoplay',
                value: 3,
                max: 60,
                min: 0,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '轮播动画时长（秒）',
                name: 'duration',
                value: 1,
                max: 30,
                min: 0,
                step: 0.5
              }
            },
            {
              type: Radio,
              option: {
                label: '是否循环',
                name: 'loop',
                list: [
                  { name: '是', value: true },
                  { name: '否', value: false }
                ],
                value: true
              }
            },
            {
              type: Radio,
              option: {
                label: '是否显示指示器',
                name: 'indicators',
                list: [
                  { name: '是', value: true },
                  { name: '否', value: false }
                ],
                value: true
              }
            },
            {
              type: Radio,
              option: {
                label: '指示器颜色类型',
                name: 'indicatorsColorType',
                list: [
                  { name: '自定义', value: false },
                  { name: '系统主题色', value: true }
                ],
                value: true,
                override: function(ths, e) {
                  ths.$nextTick(() => {
                    for (
                      let i = 0;
                      i < ths.$parent.$parent.$children.length;
                      i++
                    ) {
                      if (
                        ths.$parent.$parent.$children[i].option.name ===
												'indicatorsColor'
                      ) {
                        ths.$parent.$parent.$children[i].visible = !e
                      }
                    }
                  })
                }
              }
            },
            {
              type: Color,
              option: {
                label: '指示器颜色',
                name: 'indicatorsColor',
                value: 'rgba(255, 255, 255, 1)',
                showalpha: true
              }
            }
          ]
        },
        ...DataOption4Img('dataList', [])
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  // 资料列表页组件
  dataListOne() {
    return {
      target: dataListOne,
      parameter: {
        relate: true,
        mold: 'field',
        label: '资料列表'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'spacing',
                value: 0,
                max: 100,
                step: 1
              }
            },
            ...cellTitleOps(),
            ...imgOption(),
            { type: Link, option: { label: '详情跳转地址', name: 'link' }},
            {
              type: Mapping,
              option: {
                label: '',
                name: 'mapping',
                list: [
                  { name: '封面', code: 'imgId', value: '' },
                  {
                    name: 'oss封面',
                    code: 'imgUrl',
                    value: ''
                  },
                  {
                    name: '标题',
                    code: 'name',
                    value: ''
                  }
                ]
              }
            }
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  // 答题练习组件
  answerExercisesComp() {
    return {
      target: AnswerExercisesComp,
      parameter: {
        relate: true,
        mold: 'field',
        label: '答题练习组件'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'spacing',
                value: 20,
                max: 100,
                step: 1
              }
            },
            { type: Input, option: { label: '标题名称', name: 'titlename' }},
            { type: Input, option: { label: '标语', name: 'slogan' }},
            {
              type: Link,
              option: { label: '每日一练跳转地址', name: 'dataBackurl' }
            },
            {
              type: Link,
              option: { label: '每周一练跳转地址', name: 'weekBackurl' }
            },
            {
              type: Link,
              option: { label: '专项答题跳转地址', name: 'specialBackurl' }
            }
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  // 专区组件
  specialArea() {
    return {
      target: specialArea,
      parameter: {
        relate: true,
        mold: 'field',
        label: '专区列表'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'spacing',
                value: 20,
                max: 100,
                step: 1
              }
            },
            ...imgOption(),
            ...labelOptions(),
            { type: Link, option: { label: '跳转地址', name: 'areaBackurl' }}
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  // 新闻列表组件
  newsListStyleTwo() {
    return {
      target: newsListStyleTwo,
      parameter: {
        relate: true,
        mold: 'field',
        label: '新闻列表组件'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            { type: Link, option: { label: '跳转地址', name: 'newsBackurl' }}
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  // 答题练习组件
  answerContestComp() {
    return {
      target: AnswerContestComp,
      parameter: {
        relate: true,
        mold: 'field',
        label: '答题竞赛'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'spacing',
                value: 20,
                max: 100,
                step: 1
              }
            },
            { type: Input, option: { label: '标题名称', name: 'contestName' }},
            { type: Input, option: { label: '标语', name: 'contextSlogan' }},
            { type: Input, option: { label: '答题闯关标语', name: 'context' }},
            {
              type: Link,
              option: { label: '答题闯关跳转地址', name: 'answerBackurl' }
            },
            {
              type: Link,
              option: { label: '排行榜跳转地址', name: 'rankBackurl' }
            }
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  /**
	 * 音频课程列表
	 * @constructor
	 */
  audioCourseListComp() {
    return {
      target: audioCourseListComp,
      parameter: {
        relate: true,
        mold: 'field',
        label: '音频课程列表组件'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '图片高度',
                name: 'height',
                value: 180,
                max: 600,
                step: 10
              }
            },
            {
              type: Slider,
              option: {
                label: '图片宽度',
                name: 'imgWidth',
                value: 180,
                max: 500,
                step: 10
              }
            },
            ...imgOption(),
            { type: Input, option: { label: '按钮名称', name: 'btnName' }},
            {
              type: Switch,
              option: {
                label: '按钮位置',
                name: 'footerPosition',
                value: false,
                activetext: '右',
                inactivetext: '左'
              }
            },
            { type: Link, option: { label: '链接地址', name: 'link' }}
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },

  /**
	 * 签到组件
	 * @constructor
	 */
  signInComp() {
    return {
      target: signInComp,
      parameter: {
        relate: false,
        mold: 'field',
        label: '签到组件'
      },
      option: [
        {
          title: '基础配置',
          fields: [...BasicOption()]
        },
        ...DataOption()
      ]
    }
  },
  /**
	 * 活动列表
	 * @constructor
	 */
  activityListComp() {
    return {
      target: activityListComp,
      parameter: {
        relate: true,
        mold: 'field',
        label: '活动列表组件'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            ...labelOptions(),
            // { type: Link, option: { label: '详情地址', name: 'link' } },
            {
              type: Mapping,
              option: {
                label: '',
                name: 'mapping',
                list: [
                  { name: '名称', code: 'activityName', value: '' },
                  { name: '开始时间', code: 'startTime', value: '' },
                  { name: '结束时间', code: 'endTime', value: '' },
                  { name: '图片地址', code: 'imgUrl', value: '' },
                  { name: '图片id', code: 'imgId', value: '' }
                ]
              }
            }
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  /**
	 * 文字页脚组件
	 * @constructor
	 */
  textFooter() {
    return {
      target: textFooter,
      parameter: {
        relate: true,
        mold: 'field',
        label: '文字页脚'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '上内边距',
                name: 'paddingTop',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '下内边距',
                name: 'paddingBottom',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '左内边距',
                name: 'paddingLeft',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '右内边距',
                name: 'paddingRight',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Radio,
              option: {
                label: '对齐方式',
                name: 'footerPosition',
                list: [
                  { name: '左对齐', value: 'left' },
                  { name: '居中对齐', value: 'center' }
                ],
                value: 'center'
              }
            },
            { type: UploadImage, option: { label: '背景图片', name: 'imgBg' }}
          ]
        },
        ...DataOption()
      ]
    }
  },
  /**
	 * 图片页脚
	 * @constructor
	 */
  imgFooterComp() {
    return {
      target: imgFooterComp,
      parameter: {
        relate: false,
        mold: 'field',
        label: '图片页脚'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '上内边距',
                name: 'paddingTop',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '下内边距',
                name: 'paddingBottom',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '图片高度',
                name: 'height',
                value: 110,
                max: 350,
                step: 10
              }
            },
            {
              type: Slider,
              option: {
                label: '图片宽度',
                name: 'imgWidth',
                value: 395,
                max: 750,
                step: 10
              }
            },
            {
              type: UploadImage,
              option: { label: '底部图片', name: 'bottomImg' }
            }
          ]
        }
        // ...DataOption()
      ]
    }
  },
  /**
	 * 退出组件
	 * @constructor
	 */
  logoutComp() {
    return {
      target: logoutComp,
      parameter: {
        relate: true,
        mold: 'field',
        label: '退出按钮'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '下间距',
                name: 'bottom',
                value: 40,
                max: 300,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '按钮高度',
                name: 'height',
                value: 80,
                max: 120,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '按钮宽度',
                name: 'width',
                value: 380,
                max: 750,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '按钮圆角',
                name: 'radius',
                value: 40,
                max: 120,
                step: 1
              }
            },
            {
              type: Input,
              option: { label: '按钮文字', name: 'btnName', value: '' }
            }
          ]
        }
        // ...DataOption()
      ]
    }
  },
  /**
	 * 专项答题组件
	 * @constructor
	 */
  specialListComp() {
    return {
      target: specialListComp,
      parameter: {
        relate: false,
        mold: 'field',
        label: '专项答题列表'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'spacing',
                value: 0,
                max: 100,
                step: 1
              }
            },
            { type: Link, option: { label: '详情地址', name: 'link' }}
          ]
        },
        ...DataOption()
      ]
    }
  },
  /**
	 * 专项答题组件(固定数量)
	 * @constructor
	 */
  specialListFixedNumberComp() {
    return {
      target: specialListFixedNumberComp,
      parameter: {
        relate: true,
        mold: 'field',
        label: '专项答题组件(固定数量)'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'spacing',
                value: 0,
                max: 100,
                step: 1
              }
            },
            ...cellTitleOps(),
            {
              type: Input,
              option: {
                label: '展示数量',
                name: 'pageSize',
                value: 2,
                required: true
              }
            },
            ...moreLinkOps(),
            { type: Link, option: { label: '跳转详情', name: 'link' }}
          ]
        },
        ...DataOption()
      ]
    }
  },
  /**
	 * 固定数量课程组件
	 * @courseListFixedComp
	 * */
  courseListFixedComp() {
    return {
      target: courseListFixedComp,
      parameter: {
        relate: true,
        mold: 'field',
        label: '视频课程列表（固定数量）'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'spacing',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Switch,
              option: {
                label: '是否展示标题背景',
                name: 'isBg',
                value: true,
                activetext: '是',
                inactivetext: '否'
              }
            },
            {
              type: Switch,
              option: {
                label: '是否展示标题名称',
                name: 'isShowModuleName',
                value: true,
                activetext: '是',
                inactivetext: '否',
                override: function(ths, e) {
                  ths.$nextTick(() => {
                    for (
                      let i = 0;
                      i < ths.$parent.$parent.$children.length;
                      i++
                    ) {
                      if (
                        ths.$parent.$parent.$children[i].option.name ===
												'moduleName'
                      ) {
                        ths.$parent.$parent.$children[i].visible = e
                      }
                    }
                  })
                }
              }
            },
            {
              type: Input,
              option: {
                label: '标题名称',
                name: 'moduleName',
                value: '标题名称'
              }
            },
            {
              type: Input,
              option: {
                label: '展示数量',
                name: 'showNumber',
                value: 4
              }
            },
            {
              type: Radio,
              option: {
                label: '来源',
                name: 'origin',
                required: true,
                visible: true,
                value: 1,
                list: [
                  { name: '按本单位课程分类添加', value: 1 },
                  { name: '输入本单位标签添加', value: 2 },
                  { name: '按平台课程分类添加', value: 3 },
                  { name: '输入平台标签添加', value: 4 }
                ],
                override: function(ths, e) {
                  ths.$nextTick(() => {
                    const arr = ths.$parent.$parent.$children
                    const coms = [
                      'classify4company',
                      'label4company',
                      'classify4platform',
                      'label4platform'
                    ]
                    const err = coms.filter((item) => {
                      return item !== coms[e - 1]
                    })
                    const succ = coms.filter((item) => {
                      return item === coms[e - 1]
                    })
                    arr.forEach((item, index) => {
                      if (succ.indexOf(item.option.name) !== -1) {
                        ths.$parent.$parent.$children[index].visible = true
                      } else if (err.indexOf(item.option.name) !== -1) {
                        ths.$parent.$parent.$children[index].visible = false
                      }
                    })
                  })
                }
              }
            },
            {
              type: Area,
              option: {
                label: '选择本单位课程分类',
                required: true,
                name: 'classify4company',
                value: '',
                async: 'backend/learnClassify/getClassifyTree',
                asyncParams: {
                  classifyType: 'JNZQFL01',
                  status: 'ZT01',
                  isAppVisit: 1
                },
                props: {
                  children: 'children',
                  label: 'classifyName',
                  value: 'id',
                  checkStrictly: true
                }
              }
            },
            {
              type: Input,
              option: {
                label: '输入本单位标签',
                name: 'label4company',
                placeholder: '多个以半角状态下,分隔',
                required: true
              }
            },
            {
              type: Area,
              option: {
                label: '选择平台课程分类',
                required: true,
                name: 'classify4platform',
                value: '',
                async: 'backend/learnClassify/getPTClassifyTree',
                asyncParams: {
                  classifyType: 'JNZQFL01',
                  status: 'ZT01',
                  isAppVisit: 1
                },
                props: {
                  children: 'children',
                  label: 'classifyName',
                  value: 'id',
                  checkStrictly: true
                }
              }
            },
            {
              type: Input,
              option: {
                label: '输入平台标签',
                name: 'label4platform',
                placeholder: '多个以半角状态下,分隔',
                required: true
              }
            },
            // {
            //   type: Switch,
            //   option: {
            //     label: '是否展示更多',
            //     name: 'showMore',
            //     value: true,
            //     activetext: '是',
            //     inactivetext: '否',
            //     override: function(ths, e) {
            //       ths.$nextTick(() => {
            //         for (let i = 0; i < ths.$parent.$parent.$children.length; i++) {
            //           if (ths.$parent.$parent.$children[i].option.name === 'moreLink') {
            //             ths.$parent.$parent.$children[i].visible = e
            //           }
            //         }
            //       })
            //     }
            //   }
            // },
            // { type: Link, option: { label: '更多地址', name: 'moreLink' }},
            ...moreLinkOps(),
            { type: Link, option: { label: '详情地址', name: 'link' }},
            {
              type: Mapping,
              option: {
                label: '',
                name: 'mapping',
                list: [
                  { name: '课程图片', code: 'courseImgUrl', value: '' },
                  { name: '课程名称', code: 'courseName', value: '' },
                  { name: '课程简介', code: 'courseIntroduce', value: '' }
                ]
              }
            }
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  // 竖版卡片
  bookStyleComp() {
    return {
      target: bookStyleComp,
      parameter: {
        relate: true,
        mold: 'field',
        label: '竖版卡片'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'spacing',
                value: 24,
                max: 100,
                step: 1
              }
            },
            ...cellTitleOps(),
            ...imgOption(),
            ...moreLinkOps(),
            {
              type: Input,
              option: {
                label: '展示数量',
                name: 'number',
                value: 1,
                type: 'number'
              }
            },
            {
              type: Link,
              option: { label: '详情地址', name: 'link' }
            },
            {
              type: Mapping,
              option: {
                label: '',
                name: 'mapping',
                list: [
                  { name: '封面', code: 'imgId', value: '' },
                  { name: 'oss封面', code: 'imgUrl', value: '' },
                  { name: '标题', code: 'name', value: '' }
                ]
              }
            }
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.STRING
    }
  },
  globalSearchComp() {
    return {
      target: globalSearchComp,
      parameter: {
        label: '全局搜索',
        relate: true,
        mold: 'field'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            // {
            //   type: Input,
            //   option: { label: '组件名称', name: 'label', required: true, disabled: true }
            // },
            {
              type: Slider,
              option: {
                label: '高度',
                name: 'height',
                value: 88,
                max: 200,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '上内边距',
                name: 'paddingTop',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '下内边距',
                name: 'paddingBottom',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '左内边距',
                name: 'paddingLeft',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '右内边距',
                name: 'paddingRight',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '左右外边距',
                name: 'margins',
                value: 0,
                max: 100,
                step: 1
              }
            },
            { type: Input, option: { label: '提示词', name: 'placeholder' }},
            {
              type: Color,
              option: {
                label: '提示词字体颜色',
                name: 'tipsTypefaceColor',
                value: 'rgba(255, 255, 255, 1)',
                showalpha: true
              }
            },
            /*    {
              type: Radio,
              option: {
                label: '是否固定定位',
                name: 'isFixed',
                list: [{ name: '是', value: '1' }, { name: '否', value: '2' }],
                value: '2'
              }
            },
            {
              type: Slider,
              option: {
                label: '顶部距离',
                name: 'fixedToTop',
                value: 0,
                step: 1
              }
            },*/
            {
              type: Input,
              option: { label: '按钮文字', name: 'btnName', value: '搜索' }
            },
            { type: Link, option: { label: '配置搜索地址', name: 'moreLink' }},
            {
              type: Radio,
              option: {
                label: '背景颜色',
                name: 'sysOrCustomBgColor',
                list: [
                  { name: '跟随系统', value: false },
                  { name: '自定义', value: true }
                ],
                value: false,
                override: function(ths, e) {
                  ths.$nextTick(() => {
                    for (
                      let i = 0;
                      i < ths.$parent.$parent.$children.length;
                      i++
                    ) {
                      const name = ths.$parent.$parent.$children[i].option.name
                      if (name === 'CustomSearchColor') {
                        ths.$parent.$parent.$children[i].visible = e
                      }
                    }
                  })
                  // ths.$nextTick(() => {})
                }
              }
            },
            {
              type: Color,
              option: {
                label: '自定义背景颜色',
                name: 'CustomSearchColor',
                value: 'rgba(255, 255, 255, 1)',
                showalpha: true
              }
            }
          ]
        }
      ],
      valueType: Types.VALUETYPES.CATEGORYCHANGE
    }
  },
  /**
	 * 标题组件
	 */
  titleComp() {
    return {
      target: TitleComp,
      parameter: {
        label: '标题组件',
        relate: false,
        mold: 'field'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            ...titleOps(),
            ...radiusSizeOps(),
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'spacing',
                value: 0,
                max: 100,
                step: 1
              }
            },
            ...moreLinkOps()
          ]
        }
      ]
    }
  },

  // 点赞组件
  affirm() {
    return {
      target: affirm,
      parameter: {
        label: '点赞组件',
        relate: true,
        mold: 'field'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            // ...titleOps(),
            // ...radiusSizeOps(),
            {
              type: Slider,
              option: {
                label: '组件高度',
                name: 'height',
                min: 70,
                value: 70,
                max: 150,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'spacing',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '剩余点赞次数宽度',
                name: 'affirmWidth',
                min: 250,
                value: 300,
                max: 400,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '剩余点赞次数高度',
                name: 'affirmHeight',
                min: 40,
                value: 70,
                max: 100,
                step: 1
              }
            },
            {
              type: Slider,
              option: {
                label: '剩余点赞次数圆角大小',
                name: 'affirmBorderRadio',
                value: 0,
                max: 35,
                step: 1
              }
            },
            ...bgImgColor(),
            {
              type: UploadImage,
              option: {
                label: '剩余点赞次数背景图片',
                name: 'imgBgAffirm',
                required: true
              }
            },
            {
              type: Color,
              option: {
                label: '剩余点赞次数背景颜色',
                name: 'bgcolorAffirm',
                value: '#fff',
                showalpha: true
              }
            },
            {
              type: Color,
              option: {
                label: '点赞数量字体颜色',
                name: 'affirmNumColor',
                value: '#ff0000',
                showalpha: true
              }
            }
          ]
        }
      ]
    }
  },
  // 展品列表组件
  exhibit() {
    return {
      target: exhibit,
      parameter: {
        label: '展品列表组件',
        relate: true,
        mold: 'field'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Color,
              option: {
                label: '标题颜色',
                name: 'titleColor',
                value: '#fff',
                showalpha: true
              }
            },
            {
              type: Color,
              option: {
                label: '副标题标题颜色',
                name: 'SubtitleColor',
                value: '#fff',
                showalpha: true
              }
            },
            {
              type: Radio,
              option: {
                label: '是否使用瀑布流',
                name: 'isWaterfall',
                list: [
                  { name: '是', value: true },
                  { name: '否', value: false }
                ],
                value: false
              }
            },
            {
              type: Select,
              option: {
                label: '图片填充模式',
                name: 'imgType',
                list: [
                  { name: '填充满', value: 'fill' },
                  { name: '等比', value: 'contain' }
                ],
                value: 'fill'
              }
            },
            {
              type: Extend,
              option: {
                label: '标签',
                name: 'ActivityLabel',
                initalize: true,
                fields: [
                  {
                    type: Area,
                    option: {
                      label: '选择标签分类',
                      required: true,
                      name: 'type',
                      value: '',
                      async: '/backend/sysClassify/getClassifyTree',
                      asyncParams: {
                        classifyType: 'FLLX_BQ',
                        status: 'ZT01',
                        t: new Date().getTime()
                      },
                      props: {
                        children: 'children',
                        label: 'classifyName',
                        value: 'code',
                        checkStrictly: true
                      }
                    }
                  },
                  {
                    type: Select,
                    option: {
                      name: 'position',
                      label: '标签位置',
                      list: [
                        {
                          name: '默认',
                          value: 'default'
                        },
                        {
                          name: '左上',
                          value: 'topLeft'
                        },
                        {
                          name: '右上',
                          value: 'topRight'
                        },
                        {
                          name: '左下',
                          value: 'bottomLeft'
                        },
                        {
                          name: '右下',
                          value: 'bottomRight'
                        }
                      ],
                      value: ''
                    }
                  },
                  { type: Input, option: { label: '标签标识', name: 'key' }}
                ]
              }
            },
            {
              type: Mapping,
              option: {
                label: '',
                name: 'mapping',
                list: [
                  { name: '封面', code: 'coverImgId', value: '' },
                  { name: 'oss封面', code: 'coverImgIdUrl', value: '' },
                  { name: '标题', code: 'mainTitle', value: '' },
                  { name: '时间', code: 'publishTime', value: '' }
                ]
              }
            }
          ]
        }
      ]
    }
  },
  // 展室列表组件
  exhibitionRoom() {
    return {
      target: exhibitionRoom,
      parameter: {
        relate: false,
        mold: 'field',
        label: '展室列表组件'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右边距',
                name: 'spacing',
                value: 0,
                max: 100,
                step: 1
              }
            },
            {
              type: Radio,
              option: {
                label: '列表展示样式',
                name: 'styleDisplay',
                type: 'button',
                list: [
                  { name: '列表展示', value: '1' },
                  { name: '网格展示', value: '2' }
                ],
                layout: 'horizon',
                value: '1',
                override: function(ths, e) {
                  console.log(ths, e, 3692)
                  ths.$nextTick(() => {
                    for (
                      let i = 0;
                      i < ths.$parent.$parent.$children.length;
                      i++
                    ) {
                      if (
                        ths.$parent.$parent.$children[i].option.name ===
												'isWaterfall'
                      ) {
                        ths.$parent.$parent.$children[i].visible = e !== '1'
                      }
                    }
                  })
                }
              }
            },
            {
              type: Radio,
              option: {
                label: '是否使用瀑布流',
                name: 'isWaterfall',
                list: [
                  { name: '是', value: true },
                  { name: '否', value: false }
                ],
                value: true
              }
            },
            {
              type: Radio,
              option: {
                label: '是否展示副标题',
                name: 'showSubTilte',
                list: [
                  { name: '是', value: true },
                  { name: '否', value: false }
                ],
                value: true
              }
            },

            // {
            //   type: Switch,
            //   option: {
            //     label: '是否支持点赞',
            //     name: 'thumbsUp',
            //     value: false,
            //     activetext: '是',
            //     inactivetext: '否',
            //     override: function(ths, e) {
            //       ths.$nextTick(() => {
            //         for (
            //           let i = 0;
            //           i < ths.$parent.$parent.$children.length;
            //           i++
            //         ) {
            //           if (
            //             ths.$parent.$parent.$children[i].option.name ===	'Likes'
            //           ) {
            //             ths.$parent.$parent.$children[i].visible = e
            //           }
            //         }
            //       })
            //     }
            //   }
            // },
            // {
            //   type: Radio,
            //   option: {
            //     label: '是否显示点赞量',
            //     name: 'Likes',
            //     list: [
            //       { name: '是', value: true },
            //       { name: '否', value: false }
            //     ],
            //     value: true
            //   }
            // },
            {
              type: Select,
              option: {
                label: '图片填充模式',
                name: 'imgType',
                list: [
                  { name: '填充满', value: 'fill' },
                  { name: '等比', value: 'contain' }
                ],
                value: 'fill'
              }
            },
            ...labelOptions(),

            {
              type: Mapping,
              option: {
                label: '',
                name: 'mapping',
                list: [
                  { name: '封面', code: 'coverImgId', value: '' },
                  { name: 'oss封面', code: 'coverImgIdUrl', value: '' },
                  { name: '标题', code: 'mainTitle', value: '' },
                  { name: '副标题', code: 'subTitle', value: '' },
                  { name: '时间', code: 'publishTime', value: '' }
                ]
              }
            }
          ]
        },
        ...DataOption()
      ]
    }
  },
  // 展室(固定数量)组件
  exhibitionRoomFixed() {
    return {
      target: exhibitionRoomFixed,
      parameter: {
        relate: false,
        mold: 'field',
        label: '展室(固定数量)'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右间距',
                name: 'spacing',
                value: 0,
                max: 100,
                step: 1
              }
            },
            ...cellTitleOps(),
            // { type: Input, option: { label: '标题名称', name: 'title', value: '展室固定数量', required: true }},
            {
              type: Radio,
              option: {
                label: '列表展示样式',
                name: 'styleDisplay',
                type: 'button',
                list: [
                  { name: '列表展示', value: '1' },
                  { name: '网格展示', value: '2' }
                ],
                layout: 'horizon',
                value: '1'
              }
            },
            {
              type: Radio,
              option: {
                label: '是否展示副标题',
                name: 'showSubTilte',
                list: [
                  { name: '是', value: true },
                  { name: '否', value: false }
                ],
                value: true
              }
            },
            // {
            //   type: Switch,
            //   option: {
            //     label: '是否支持点赞',
            //     name: 'thumbsUp',
            //     value: false,
            //     activetext: '是',
            //     inactivetext: '否',
            //     override: function(ths, e) {
            //       ths.$nextTick(() => {
            //         for (
            //           let i = 0;
            //           i < ths.$parent.$parent.$children.length;
            //           i++
            //         ) {
            //           if (
            //             ths.$parent.$parent.$children[i].option.name ===	'Likes'
            //           ) {
            //             ths.$parent.$parent.$children[i].visible = e
            //           }
            //         }
            //       })
            //     }
            //   }
            // },
            // {
            //   type: Radio,
            //   option: {
            //     label: '是否显示点赞量',
            //     name: 'Likes',
            //     list: [
            //       { name: '是', value: true },
            //       { name: '否', value: false }
            //     ],
            //     value: true
            //   }
            // },
            {
              type: Select,
              option: {
                label: '图片填充模式',
                name: 'imgType',
                list: [
                  { name: '填充满', value: 'fill' },
                  { name: '等比', value: 'contain' }
                ],
                value: 'fill'
              }
            },
            ...moreLinkOps(),
            ...labelOptions()
          ]
        },
        ...DataOption()
      ]
    }
  },
  // 展品列表组件-固定数量
  exhibit_regular() {
    return {
      target: exhibit_regular,
      parameter: {
        label: '展品列表-固定数量',
        relate: true,
        mold: 'field'
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Radio,
              option: {
                label: '是否使用瀑布流',
                name: 'isWaterfall',
                list: [
                  { name: '是', value: true },
                  { name: '否', value: false }
                ],
                value: false
              }
            },
            ...cellTitleOps(),
            {
              type: Color,
              option: {
                label: '内容标题颜色',
                name: 'contentTitleColor',
                value: '#fff',
                showalpha: true
              }
            },
            {
              type: Color,
              option: {
                label: '副标题标题颜色',
                name: 'SubtitleColor',
                value: '#fff',
                showalpha: true
              }
            },
            {
              type: Input,
              option: { label: '展示数量', name: 'exhibitNum', value: 10 }
            },
            {
              type: Select,
              option: {
                label: '图片填充模式',
                name: 'imgType',
                list: [
                  { name: '填充满', value: 'fill' },
                  { name: '等比', value: 'contain' }
                ],
                value: 'fill'
              }
            },
            {
              type: Extend,
              option: {
                label: '标签',
                name: 'ActivityLabel',
                initalize: true,
                fields: [
                  {
                    type: Area,
                    option: {
                      label: '选择标签分类',
                      required: true,
                      name: 'type',
                      value: '',
                      async: '/backend/sysClassify/getClassifyTree',
                      asyncParams: {
                        classifyType: 'FLLX_BQ',
                        status: 'ZT01',
                        t: new Date().getTime()
                      },
                      props: {
                        children: 'children',
                        label: 'classifyName',
                        value: 'code',
                        checkStrictly: true
                      }
                    }
                  },
                  {
                    type: Select,
                    option: {
                      name: 'position',
                      label: '标签位置',
                      list: [
                        {
                          name: '默认',
                          value: 'default'
                        },
                        {
                          name: '左上',
                          value: 'topLeft'
                        },
                        {
                          name: '右上',
                          value: 'topRight'
                        },
                        {
                          name: '左下',
                          value: 'bottomLeft'
                        },
                        {
                          name: '右下',
                          value: 'bottomRight'
                        }
                      ],
                      value: ''
                    }
                  },
                  { type: Input, option: { label: '标签标识', name: 'key' }}
                ]
              }
            },
            ...moreLinkOps(),
            {
              type: Mapping,
              option: {
                label: '',
                name: 'mapping',
                list: [
                  { name: '封面', code: 'coverImgId', value: '' },
                  { name: 'oss封面', code: 'coverImgIdUrl', value: '' },
                  { name: '标题', code: 'mainTitle', value: '' },
                  { name: '时间', code: 'publishTime', value: '' }
                ]
              }
            }
          ]
        }
      ]
    }
  }
}
const FieldsMap = {
  Fields,
  invokeOperate({ operate, rvalue, rvalueType, lvalue, lvalueType, data }) {
    return Types.invokeOperate({
      operate,
      rvalue,
      rvalueType,
      lvalue,
      lvalueType,
      data
    })
  },
  getField(name) {
    const t = Fields[name]
    if (t !== undefined) {
      const info = t()
      let parameter = {}
      if (info.defaultOption) {
        parameter = Object.assign({}, info.parameter, info.defaultOption(info))
      } else {
        parameter = info.parameter
      }
      return { ...info, parameter, name }
    }
    return {
      target: Empty,
      name: 'empty',
      option: [],
      parameter: {
        relate: false,
        mold: 'field',
        label: '组件不存在'
      }
    }
  },
  getFieldOperators(name) {
    const t = Fields[name]
    if (t) {
      return Types.getTypeOperators(t().valueType)
    }
  },
  getFieldOptionForm(name, values, env) {
    const t = this.getField(name)
    if (t) {
      return (t.option || []).map((info) => {
        let { title, fields } = info
        if (typeof fields === 'function') {
          fields = fields(env)
        }
        fields = fields.map(({ type, option }) => {
          if (values.hasOwnProperty(option.name)) {
            option.value = values[option.name]
          }
          return { type, option }
        })
        return { title, fields }
      })
    }
    return null
  }
}

export default FieldsMap
